<?php

class Core_Form_Person extends Zend_Form{


    public function __construct($view , $data = null)
    {
        parent::__construct();
        $this->setView($view);
        $person = new Zend_Form_Element_Text("name");
        $person->setLabel("候选人");
        $link = new Zend_Form_Element_Text("link");
        $link->setLabel("详细信息");
        $submit = new Zend_Form_Element_Submit("submit");
        $submit->setLabel("登录");
        $reset = new Zend_Form_Element_Submit("reset");
        $reset->setLabel("重置");
        $this->addElements(array($person , $link , $submit , $reset));

        if (is_array($data) && count($data) > 0)
        {
            foreach($data as $key=>$value)
            {
                if ($key != '')
                {
                    if ($key == 'name')
                    {
                        $person->setValue($value);
                    }

                    if ($key == 'link')
                    {
                        $link->setValue($value);
                    }
                }
            }
        }
    }



}